package com.yupi.springbootinit.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtil implements InitializingBean {
    @Value("${cos.client.region}")
    private String region;
    @Value("${cos.client.accessKey}")
    private String accessKey;
    @Value("${cos.client.secretKey}")
    private String secretKey;
    @Value("${cos.client.bucket}")
    private String bucket;

    public static String END_POINT;
    public static String BUCKET_NAME;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;

    @Override
    public void afterPropertiesSet() throws Exception {
                END_POINT = region;
                BUCKET_NAME = bucket;
                ACCESS_KEY_ID = accessKey;
                ACCESS_KEY_SECRET = secretKey;
    }
}
